<%@ page import="com.actimind.actitime.Version"%>
<%@ taglib uri="/WEB-INF/at.tld" prefix="at" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ page errorPage="/error.jsp" %>
<html>
<head>
    <title><bean:write name="title-prefix" scope="application"/> Login</title>

    <script language="JavaScript">
    if (window.opener && (window.name == 'popup' || window.name.indexOf('popup') == 0))
    {
        window.opener.location.href = window.location.href;
        window.opener.focus();
        window.close();
    }
    </script>
    <script language="JavaScript" src="js/md5.js"></script>
    <script language="JavaScript" src="js/at.js"></script>
    <script language="JavaScript">
    function doLogin(f)
    {
      /*  if (notEmpty(f.username, 'Please specify username.') &&
            notEmpty(f.pwd, 'Please specify password'))
        { */
            f.submitted.value = 1;

            f.password.value = MD5(MD5(f.pwd.value) + f.challenge.value + trim(f.username.value).toLowerCase());

            f.pwd.value = "";
            f.challenge.value = "";

            return true;
        // }
    }

    function initKeys()
    {
        document.forms[0].autocompletion="off";
        document.forms[0].username.focus();
    }

    </script>
    <link rel="stylesheet" href="css/at.css" type="text/css">
    <style type="text/css">
    .version
    {
        color: #ffffff;
        font-weight: bold;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 9pt;
    }
    </style>
</head>

<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" onLoad="initKeys()">

<html:form scope="session" action="login" method="post" onsubmit="return doLogin(document.forms[0]);" >
<input type="hidden" name="password">
<html:hidden property="challenge" />

<input type="hidden" name="submitted" value="0" />

<table width="100%" height="100%" cellspacing="0" cellpadding="0" align="center" valign="middle" border="0" bgcolor="#ffffff">
<tr>
    <td><img src="img/pixel.gif" height="100" width="1"/></td>
</tr>
<tr>
    <td>
        <table width="460" cellspacing="0" cellpadding="0" align="center" border="0" bgcolor="#18409D">
        <tr>
            <td colspan="5"><img height="30" width="1" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td colspan="5" align="center">
            <span class="logintitle">Intelligent Time Tracking Identification and efficient billing management Software <br>Login</span>
			
            <span class="version">&nbsp;&nbsp;</span>
            </td>
        </tr>
        <tr>
            <td colspan="5"><img height="20" width="1" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td rowspan="4"><img height="1" width="30" src="img/pixel.gif"></td>
            <td><img height="45" width="10" src="img/pixel.gif"></td>
            <td class="logintext" valign="top">Welcome!<br />Please identify yourself with a username and password:</td>
            <td><img height="1" width="10" src="img/pixel.gif"></td>
            <td rowspan="4"><img height="1" width="30" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td bgcolor="#6995DE"><img height="45" width="10" src="img/pixel.gif"></td>
            <td bgcolor="#6995DE">
                <table width="100%" height="100%" cellspacing="0" cellpadding="0" align="center" valign="middle" border="0">
                <tr>
                    <td colspan="2"><img height="10" width="1" src="img/pixel.gif"></td>
                </tr>
                <tr>
                    <td class="logintext"><b>Username:</b></td>
                    <td><html:text property="username" style="width: 203px" /></td>
                </tr>
                <tr>
                    <td colspan="2"><img height="10" width="1" src="img/pixel.gif"></td>
                </tr>
                <tr>
                    <td class="logintext"><b>Password:</b></td>
                    <td><html:password property="pwd" style="width: 203px" redisplay="false" /></td>
                </tr>
                <tr>
                    <td colspan="2"><img height="10" width="1" src="img/pixel.gif"></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td><input type="submit" valign="absmiddle" value="&nbsp;Login now&nbsp;"></td>
                </tr>
                <tr>
                    <td colspan="2"><img height="10" width="1" src="img/pixel.gif"></td>
                </tr>
                </table>
            </td>
            <td bgcolor="#6995DE"><img height="45" width="10" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td colspan="3"><img height="10" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td height="35" width="7"><img height="35" width="7" src="img/pixel.gif"></td>
            <td height="35" width="386" class="loginerror" valign="top"><img height="1" width="1" src="img/pixel.gif"><at:errors/></td>
            <td height="35" width="7"><img height="35" width="7" src="img/pixel.gif"></td>
        </tr>
        </table>
    </td>
</tr>
<tr>
    <td><img src="img/pixel.gif" height="100" width="1"/></td>
</tr>
<tr>
    <td align="center" valign="bottom" height="44">
        <table height="24" cellspacing="0" cellpadding="0" align="center" valign="middle" border="0" bgcolor="#ffffff">
        <tr>
            <td align="right" valign="top">
                <img src="img/small_logo.gif" width="24" height="24">
            </td>
            <td>
                <img height="24" width="10" src="img/pixel.gif">
            </td>
            <td><font size=4 color=darkblue><b>Intelligent Time Tracking Identification and efficient billing management Software<b></font></td>
        </tr>
        <tr>
            <td colspan="3">
                <img height="20" width="1" src="img/pixel.gif">
            </td>
        </table>
    </td>
</tr>
</table>
</html:form>

</body>
</html>